/*!
  \copyright  Copyright (c) 2024 Qualcomm Technologies International, Ltd.
              All Rights Reserved.
              Qualcomm Technologies International, Ltd. Confidential and Proprietary.
  \file
  \brief      QSS Audio Data Reader based on Kymera
*/

#ifdef INCLUDE_QSS

#include "qss_manager_audio_if.h"
#include "kymera.h"
#include "kymera_qss.h"
#include "qss_manager_msg.h"

static void qssManager_MessageHandler(Task task, MessageId id, Message message);
static TaskData kymera_task_data = {qssManager_MessageHandler};
static Task qss_manager_task;

static void qssManager_MessageHandler(Task task, MessageId id, Message message)
{
    if(!qss_manager_task)
    {
        return;
    }

    switch(id)
    {
        case KYMERA_APTX_ADAPTIVE_STREAMING_START_IND:
            qss_manager_task->handler(qss_manager_task, QSS_MANAGER_APTX_ADAPTIVE_STREAMING_START_IND, message);
            break;
        case KYMERA_APTX_ADAPTIVE_STREAMING_STOP_IND:
            qss_manager_task->handler(qss_manager_task, QSS_MANAGER_APTX_ADAPTIVE_STREAMING_STOP_IND, message);
            break;
    }
}

bool QssManager_ReadAptxAdaptiveLosslesssInfo(uint32 *lossless_audio_data)
{
    return KymeraQss_ReadAptxAdaptiveLosslesssInfo(lossless_audio_data);
}

void QssManager_RegisterAptxAdaptiveStreamingListener(Task client_task)
{
    qss_manager_task = client_task;
    Kymera_RegisterNotificationListener(&kymera_task_data);
}

#endif
